\(\int x^2 (a+b \tan (c+d \sqrt {x}))^2 \, dx\) [31]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [F]
   Fricas [F]
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 402 \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=-\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {30 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {15 b^2 \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {30 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {15 i a b \operatorname {PolyLog}\left (6,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d} \]

[Out]

10*I*a*b*x^2*polylog(2,-exp(2*I*(c+d*x^(1/2))))/d^2+1/3*a^2*x^3-2*I*b^2*x^(5/2)/d-1/3*b^2*x^3+10*b^2*x^2*ln(1+
exp(2*I*(c+d*x^(1/2))))/d^2-4*a*b*x^(5/2)*ln(1+exp(2*I*(c+d*x^(1/2))))/d-30*I*a*b*x*polylog(4,-exp(2*I*(c+d*x^
(1/2))))/d^4+2/3*I*a*b*x^3+30*b^2*x*polylog(3,-exp(2*I*(c+d*x^(1/2))))/d^4-20*a*b*x^(3/2)*polylog(3,-exp(2*I*(
c+d*x^(1/2))))/d^3-20*I*b^2*x^(3/2)*polylog(2,-exp(2*I*(c+d*x^(1/2))))/d^3-15*b^2*polylog(5,-exp(2*I*(c+d*x^(1
/2))))/d^6+15*I*a*b*polylog(6,-exp(2*I*(c+d*x^(1/2))))/d^6+30*I*b^2*polylog(4,-exp(2*I*(c+d*x^(1/2))))*x^(1/2)
/d^5+30*a*b*polylog(5,-exp(2*I*(c+d*x^(1/2))))*x^(1/2)/d^5+2*b^2*x^(5/2)*tan(c+d*x^(1/2))/d

Rubi [A] (verified)

Time = 0.70 (sec) , antiderivative size = 402, normalized size of antiderivative = 1.00, number of steps used = 20, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3832, 3803, 3800, 2221, 2611, 6744, 2320, 6724, 3801, 30} \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {a^2 x^3}{3}+\frac {15 i a b \operatorname {PolyLog}\left (6,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {30 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {2}{3} i a b x^3-\frac {15 b^2 \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {30 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {2 i b^2 x^{5/2}}{d}-\frac {b^2 x^3}{3} \]

[In]

Int[x^2*(a + b*Tan[c + d*Sqrt[x]])^2,x]

[Out]

((-2*I)*b^2*x^(5/2))/d + (a^2*x^3)/3 + ((2*I)/3)*a*b*x^3 - (b^2*x^3)/3 + (10*b^2*x^2*Log[1 + E^((2*I)*(c + d*S
qrt[x]))])/d^2 - (4*a*b*x^(5/2)*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d - ((20*I)*b^2*x^(3/2)*PolyLog[2, -E^((2*
I)*(c + d*Sqrt[x]))])/d^3 + ((10*I)*a*b*x^2*PolyLog[2, -E^((2*I)*(c + d*Sqrt[x]))])/d^2 + (30*b^2*x*PolyLog[3,
 -E^((2*I)*(c + d*Sqrt[x]))])/d^4 - (20*a*b*x^(3/2)*PolyLog[3, -E^((2*I)*(c + d*Sqrt[x]))])/d^3 + ((30*I)*b^2*
Sqrt[x]*PolyLog[4, -E^((2*I)*(c + d*Sqrt[x]))])/d^5 - ((30*I)*a*b*x*PolyLog[4, -E^((2*I)*(c + d*Sqrt[x]))])/d^
4 - (15*b^2*PolyLog[5, -E^((2*I)*(c + d*Sqrt[x]))])/d^6 + (30*a*b*Sqrt[x]*PolyLog[5, -E^((2*I)*(c + d*Sqrt[x])
)])/d^5 + ((15*I)*a*b*PolyLog[6, -E^((2*I)*(c + d*Sqrt[x]))])/d^6 + (2*b^2*x^(5/2)*Tan[c + d*Sqrt[x]])/d

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 3800

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x
] - Dist[2*I, Int[(c + d*x)^m*(E^(2*I*(e + f*x))/(1 + E^(2*I*(e + f*x)))), x], x] /; FreeQ[{c, d, e, f}, x] &&
 IGtQ[m, 0]

Rule 3801

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(c + d*x)^m*((b*Tan[e
 + f*x])^(n - 1)/(f*(n - 1))), x] + (-Dist[b*d*(m/(f*(n - 1))), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 3803

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Tan[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 3832

Int[(x_)^(m_.)*((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Tan[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rule 6744

Int[((e_.) + (f_.)*(x_))^(m_.)*PolyLog[n_, (d_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(p_.)], x_Symbol] :> Simp
[(e + f*x)^m*(PolyLog[n + 1, d*(F^(c*(a + b*x)))^p]/(b*c*p*Log[F])), x] - Dist[f*(m/(b*c*p*Log[F])), Int[(e +
f*x)^(m - 1)*PolyLog[n + 1, d*(F^(c*(a + b*x)))^p], x], x] /; FreeQ[{F, a, b, c, d, e, f, n, p}, x] && GtQ[m,
0]

Rubi steps \begin{align*} \text {integral}& = 2 \text {Subst}\left (\int x^5 (a+b \tan (c+d x))^2 \, dx,x,\sqrt {x}\right ) \\ & = 2 \text {Subst}\left (\int \left (a^2 x^5+2 a b x^5 \tan (c+d x)+b^2 x^5 \tan ^2(c+d x)\right ) \, dx,x,\sqrt {x}\right ) \\ & = \frac {a^2 x^3}{3}+(4 a b) \text {Subst}\left (\int x^5 \tan (c+d x) \, dx,x,\sqrt {x}\right )+\left (2 b^2\right ) \text {Subst}\left (\int x^5 \tan ^2(c+d x) \, dx,x,\sqrt {x}\right ) \\ & = \frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}-(8 i a b) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x^5}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt {x}\right )-\left (2 b^2\right ) \text {Subst}\left (\int x^5 \, dx,x,\sqrt {x}\right )-\frac {\left (10 b^2\right ) \text {Subst}\left (\int x^4 \tan (c+d x) \, dx,x,\sqrt {x}\right )}{d} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}+\frac {(20 a b) \text {Subst}\left (\int x^4 \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d}+\frac {\left (20 i b^2\right ) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x^4}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt {x}\right )}{d} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(40 i a b) \text {Subst}\left (\int x^3 \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2}-\frac {\left (40 b^2\right ) \text {Subst}\left (\int x^3 \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^2} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}+\frac {(60 a b) \text {Subst}\left (\int x^2 \operatorname {PolyLog}\left (3,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^3}+\frac {\left (60 i b^2\right ) \text {Subst}\left (\int x^2 \operatorname {PolyLog}\left (2,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^3} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}+\frac {(60 i a b) \text {Subst}\left (\int x \operatorname {PolyLog}\left (4,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^4}-\frac {\left (60 b^2\right ) \text {Subst}\left (\int x \operatorname {PolyLog}\left (3,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^4} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {30 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {30 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}-\frac {(30 a b) \text {Subst}\left (\int \operatorname {PolyLog}\left (5,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^5}-\frac {\left (30 i b^2\right ) \text {Subst}\left (\int \operatorname {PolyLog}\left (4,-e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d^5} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {30 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}+\frac {30 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d}+\frac {(15 i a b) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(5,-x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}-\frac {\left (15 b^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(4,-x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6} \\ & = -\frac {2 i b^2 x^{5/2}}{d}+\frac {a^2 x^3}{3}+\frac {2}{3} i a b x^3-\frac {b^2 x^3}{3}+\frac {10 b^2 x^2 \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {4 a b x^{5/2} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {20 i b^2 x^{3/2} \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {10 i a b x^2 \operatorname {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}+\frac {30 b^2 x \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {20 a b x^{3/2} \operatorname {PolyLog}\left (3,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^3}+\frac {30 i b^2 \sqrt {x} \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}-\frac {30 i a b x \operatorname {PolyLog}\left (4,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^4}-\frac {15 b^2 \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {30 a b \sqrt {x} \operatorname {PolyLog}\left (5,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^5}+\frac {15 i a b \operatorname {PolyLog}\left (6,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^6}+\frac {2 b^2 x^{5/2} \tan \left (c+d \sqrt {x}\right )}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 3.81 (sec) , antiderivative size = 567, normalized size of antiderivative = 1.41 \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\frac {1}{3} \left (-\frac {i b e^{2 i c} \left (-12 b d^5 e^{-2 i c} x^{5/2}+4 a d^6 e^{-2 i c} x^3+30 i b d^4 e^{-2 i c} \left (1+e^{2 i c}\right ) x^2 \log \left (1+e^{-2 i \left (c+d \sqrt {x}\right )}\right )-12 i a d^5 e^{-2 i c} \left (1+e^{2 i c}\right ) x^{5/2} \log \left (1+e^{-2 i \left (c+d \sqrt {x}\right )}\right )-60 b d^3 \left (1+e^{-2 i c}\right ) x^{3/2} \operatorname {PolyLog}\left (2,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+30 a d^4 \left (1+e^{-2 i c}\right ) x^2 \operatorname {PolyLog}\left (2,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+90 i b d^2 e^{-2 i c} \left (1+e^{2 i c}\right ) x \operatorname {PolyLog}\left (3,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )-60 i a d^3 e^{-2 i c} \left (1+e^{2 i c}\right ) x^{3/2} \operatorname {PolyLog}\left (3,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+90 b d \left (1+e^{-2 i c}\right ) \sqrt {x} \operatorname {PolyLog}\left (4,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )-90 a d^2 \left (1+e^{-2 i c}\right ) x \operatorname {PolyLog}\left (4,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )-45 i b e^{-2 i c} \left (1+e^{2 i c}\right ) \operatorname {PolyLog}\left (5,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+90 i a d e^{-2 i c} \left (1+e^{2 i c}\right ) \sqrt {x} \operatorname {PolyLog}\left (5,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )+45 a \left (1+e^{-2 i c}\right ) \operatorname {PolyLog}\left (6,-e^{-2 i \left (c+d \sqrt {x}\right )}\right )\right )}{d^6 \left (1+e^{2 i c}\right )}+\frac {6 b^2 x^{5/2} \sec (c) \sec \left (c+d \sqrt {x}\right ) \sin \left (d \sqrt {x}\right )}{d}+x^3 \left (a^2-b^2+2 a b \tan (c)\right )\right ) \]

[In]

Integrate[x^2*(a + b*Tan[c + d*Sqrt[x]])^2,x]

[Out]

(((-I)*b*E^((2*I)*c)*((-12*b*d^5*x^(5/2))/E^((2*I)*c) + (4*a*d^6*x^3)/E^((2*I)*c) + ((30*I)*b*d^4*(1 + E^((2*I
)*c))*x^2*Log[1 + E^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) - ((12*I)*a*d^5*(1 + E^((2*I)*c))*x^(5/2)*Log[1 + E
^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) - 60*b*d^3*(1 + E^((-2*I)*c))*x^(3/2)*PolyLog[2, -E^((-2*I)*(c + d*Sqr
t[x]))] + 30*a*d^4*(1 + E^((-2*I)*c))*x^2*PolyLog[2, -E^((-2*I)*(c + d*Sqrt[x]))] + ((90*I)*b*d^2*(1 + E^((2*I
)*c))*x*PolyLog[3, -E^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) - ((60*I)*a*d^3*(1 + E^((2*I)*c))*x^(3/2)*PolyLog
[3, -E^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) + 90*b*d*(1 + E^((-2*I)*c))*Sqrt[x]*PolyLog[4, -E^((-2*I)*(c + d
*Sqrt[x]))] - 90*a*d^2*(1 + E^((-2*I)*c))*x*PolyLog[4, -E^((-2*I)*(c + d*Sqrt[x]))] - ((45*I)*b*(1 + E^((2*I)*
c))*PolyLog[5, -E^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) + ((90*I)*a*d*(1 + E^((2*I)*c))*Sqrt[x]*PolyLog[5, -E
^((-2*I)*(c + d*Sqrt[x]))])/E^((2*I)*c) + 45*a*(1 + E^((-2*I)*c))*PolyLog[6, -E^((-2*I)*(c + d*Sqrt[x]))]))/(d
^6*(1 + E^((2*I)*c))) + (6*b^2*x^(5/2)*Sec[c]*Sec[c + d*Sqrt[x]]*Sin[d*Sqrt[x]])/d + x^3*(a^2 - b^2 + 2*a*b*Ta
n[c]))/3

Maple [F]

\[\int x^{2} \left (a +b \tan \left (c +d \sqrt {x}\right )\right )^{2}d x\]

[In]

int(x^2*(a+b*tan(c+d*x^(1/2)))^2,x)

[Out]

int(x^2*(a+b*tan(c+d*x^(1/2)))^2,x)

Fricas [F]

\[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int { {\left (b \tan \left (d \sqrt {x} + c\right ) + a\right )}^{2} x^{2} \,d x } \]

[In]

integrate(x^2*(a+b*tan(c+d*x^(1/2)))^2,x, algorithm="fricas")

[Out]

integral(b^2*x^2*tan(d*sqrt(x) + c)^2 + 2*a*b*x^2*tan(d*sqrt(x) + c) + a^2*x^2, x)

Sympy [F]

\[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int x^{2} \left (a + b \tan {\left (c + d \sqrt {x} \right )}\right )^{2}\, dx \]

[In]

integrate(x**2*(a+b*tan(c+d*x**(1/2)))**2,x)

[Out]

Integral(x**2*(a + b*tan(c + d*sqrt(x)))**2, x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2421 vs. \(2 (320) = 640\).

Time = 0.60 (sec) , antiderivative size = 2421, normalized size of antiderivative = 6.02 \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\text {Too large to display} \]

[In]

integrate(x^2*(a+b*tan(c+d*x^(1/2)))^2,x, algorithm="maxima")

[Out]

1/3*((d*sqrt(x) + c)^6*a^2 - 6*(d*sqrt(x) + c)^5*a^2*c + 15*(d*sqrt(x) + c)^4*a^2*c^2 - 20*(d*sqrt(x) + c)^3*a
^2*c^3 + 15*(d*sqrt(x) + c)^2*a^2*c^4 - 6*(d*sqrt(x) + c)*a^2*c^5 - 12*a*b*c^5*log(sec(d*sqrt(x) + c)) - 6*(30
*I*(d*sqrt(x) + c)*b^2*c^5 - 5*(2*a*b + I*b^2)*(d*sqrt(x) + c)^6 + 30*(2*a*b + I*b^2)*(d*sqrt(x) + c)^5*c - 75
*(2*a*b + I*b^2)*(d*sqrt(x) + c)^4*c^2 + 100*(2*a*b + I*b^2)*(d*sqrt(x) + c)^3*c^3 - 75*(2*a*b + I*b^2)*(d*sqr
t(x) + c)^2*c^4 + 60*b^2*c^5 + 2*(96*(d*sqrt(x) + c)^5*a*b - 75*b^2*c^4 - 150*(2*a*b*c + b^2)*(d*sqrt(x) + c)^
4 + 400*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c)^3 - 150*(2*a*b*c^3 + 3*b^2*c^2)*(d*sqrt(x) + c)^2 + 150*(a*b*c^4 + 2
*b^2*c^3)*(d*sqrt(x) + c) + (96*(d*sqrt(x) + c)^5*a*b - 75*b^2*c^4 - 150*(2*a*b*c + b^2)*(d*sqrt(x) + c)^4 + 4
00*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c)^3 - 150*(2*a*b*c^3 + 3*b^2*c^2)*(d*sqrt(x) + c)^2 + 150*(a*b*c^4 + 2*b^2*
c^3)*(d*sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) - (-96*I*(d*sqrt(x) + c)^5*a*b + 75*I*b^2*c^4 + 150*(2*I*a*b*c +
I*b^2)*(d*sqrt(x) + c)^4 + 400*(-I*a*b*c^2 - I*b^2*c)*(d*sqrt(x) + c)^3 + 150*(2*I*a*b*c^3 + 3*I*b^2*c^2)*(d*s
qrt(x) + c)^2 + 150*(-I*a*b*c^4 - 2*I*b^2*c^3)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))*arctan2(sin(2*d*sqrt(x
) + 2*c), cos(2*d*sqrt(x) + 2*c) + 1) - 5*((2*a*b + I*b^2)*(d*sqrt(x) + c)^6 - 6*(2*b^2 + (2*a*b + I*b^2)*c)*(
d*sqrt(x) + c)^5 + 15*(4*b^2*c + (2*a*b + I*b^2)*c^2)*(d*sqrt(x) + c)^4 - 20*(6*b^2*c^2 + (2*a*b + I*b^2)*c^3)
*(d*sqrt(x) + c)^3 + 15*(8*b^2*c^3 + (2*a*b + I*b^2)*c^4)*(d*sqrt(x) + c)^2 + 6*(-I*b^2*c^5 - 10*b^2*c^4)*(d*s
qrt(x) + c))*cos(2*d*sqrt(x) + 2*c) - 30*(16*(d*sqrt(x) + c)^4*a*b + 5*a*b*c^4 + 10*b^2*c^3 - 20*(2*a*b*c + b^
2)*(d*sqrt(x) + c)^3 + 40*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c)^2 - 10*(2*a*b*c^3 + 3*b^2*c^2)*(d*sqrt(x) + c) + (
16*(d*sqrt(x) + c)^4*a*b + 5*a*b*c^4 + 10*b^2*c^3 - 20*(2*a*b*c + b^2)*(d*sqrt(x) + c)^3 + 40*(a*b*c^2 + b^2*c
)*(d*sqrt(x) + c)^2 - 10*(2*a*b*c^3 + 3*b^2*c^2)*(d*sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) + (16*I*(d*sqrt(x) +
c)^4*a*b + 5*I*a*b*c^4 + 10*I*b^2*c^3 + 20*(-2*I*a*b*c - I*b^2)*(d*sqrt(x) + c)^3 + 40*(I*a*b*c^2 + I*b^2*c)*(
d*sqrt(x) + c)^2 + 10*(-2*I*a*b*c^3 - 3*I*b^2*c^2)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))*dilog(-e^(2*I*d*sq
rt(x) + 2*I*c)) + (-96*I*(d*sqrt(x) + c)^5*a*b + 75*I*b^2*c^4 - 150*(-2*I*a*b*c - I*b^2)*(d*sqrt(x) + c)^4 - 4
00*(I*a*b*c^2 + I*b^2*c)*(d*sqrt(x) + c)^3 - 150*(-2*I*a*b*c^3 - 3*I*b^2*c^2)*(d*sqrt(x) + c)^2 - 150*(I*a*b*c
^4 + 2*I*b^2*c^3)*(d*sqrt(x) + c) + (-96*I*(d*sqrt(x) + c)^5*a*b + 75*I*b^2*c^4 - 150*(-2*I*a*b*c - I*b^2)*(d*
sqrt(x) + c)^4 - 400*(I*a*b*c^2 + I*b^2*c)*(d*sqrt(x) + c)^3 - 150*(-2*I*a*b*c^3 - 3*I*b^2*c^2)*(d*sqrt(x) + c
)^2 - 150*(I*a*b*c^4 + 2*I*b^2*c^3)*(d*sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) + (96*(d*sqrt(x) + c)^5*a*b - 75*b
^2*c^4 - 150*(2*a*b*c + b^2)*(d*sqrt(x) + c)^4 + 400*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c)^3 - 150*(2*a*b*c^3 + 3*
b^2*c^2)*(d*sqrt(x) + c)^2 + 150*(a*b*c^4 + 2*b^2*c^3)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))*log(cos(2*d*sq
rt(x) + 2*c)^2 + sin(2*d*sqrt(x) + 2*c)^2 + 2*cos(2*d*sqrt(x) + 2*c) + 1) - 720*(a*b*cos(2*d*sqrt(x) + 2*c) +
I*a*b*sin(2*d*sqrt(x) + 2*c) + a*b)*polylog(6, -e^(2*I*d*sqrt(x) + 2*I*c)) - 90*(-16*I*(d*sqrt(x) + c)*a*b + 1
0*I*a*b*c + 5*I*b^2 + (-16*I*(d*sqrt(x) + c)*a*b + 10*I*a*b*c + 5*I*b^2)*cos(2*d*sqrt(x) + 2*c) + (16*(d*sqrt(
x) + c)*a*b - 10*a*b*c - 5*b^2)*sin(2*d*sqrt(x) + 2*c))*polylog(5, -e^(2*I*d*sqrt(x) + 2*I*c)) + 60*(24*(d*sqr
t(x) + c)^2*a*b + 10*a*b*c^2 + 10*b^2*c - 15*(2*a*b*c + b^2)*(d*sqrt(x) + c) + (24*(d*sqrt(x) + c)^2*a*b + 10*
a*b*c^2 + 10*b^2*c - 15*(2*a*b*c + b^2)*(d*sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) - (-24*I*(d*sqrt(x) + c)^2*a*b
 - 10*I*a*b*c^2 - 10*I*b^2*c + 15*(2*I*a*b*c + I*b^2)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))*polylog(4, -e^(
2*I*d*sqrt(x) + 2*I*c)) - 30*(32*I*(d*sqrt(x) + c)^3*a*b - 10*I*a*b*c^3 - 15*I*b^2*c^2 + 30*(-2*I*a*b*c - I*b^
2)*(d*sqrt(x) + c)^2 + 40*(I*a*b*c^2 + I*b^2*c)*(d*sqrt(x) + c) + (32*I*(d*sqrt(x) + c)^3*a*b - 10*I*a*b*c^3 -
 15*I*b^2*c^2 + 30*(-2*I*a*b*c - I*b^2)*(d*sqrt(x) + c)^2 + 40*(I*a*b*c^2 + I*b^2*c)*(d*sqrt(x) + c))*cos(2*d*
sqrt(x) + 2*c) - (32*(d*sqrt(x) + c)^3*a*b - 10*a*b*c^3 - 15*b^2*c^2 - 30*(2*a*b*c + b^2)*(d*sqrt(x) + c)^2 +
40*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))*polylog(3, -e^(2*I*d*sqrt(x) + 2*I*c)) - 5*((2*I
*a*b - b^2)*(d*sqrt(x) + c)^6 + 6*(-2*I*b^2 + (-2*I*a*b + b^2)*c)*(d*sqrt(x) + c)^5 + 15*(4*I*b^2*c + (2*I*a*b
 - b^2)*c^2)*(d*sqrt(x) + c)^4 + 20*(-6*I*b^2*c^2 + (-2*I*a*b + b^2)*c^3)*(d*sqrt(x) + c)^3 + 15*(8*I*b^2*c^3
+ (2*I*a*b - b^2)*c^4)*(d*sqrt(x) + c)^2 + 6*(b^2*c^5 - 10*I*b^2*c^4)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))
/(-30*I*cos(2*d*sqrt(x) + 2*c) + 30*sin(2*d*sqrt(x) + 2*c) - 30*I))/d^6

Giac [F]

\[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int { {\left (b \tan \left (d \sqrt {x} + c\right ) + a\right )}^{2} x^{2} \,d x } \]

[In]

integrate(x^2*(a+b*tan(c+d*x^(1/2)))^2,x, algorithm="giac")

[Out]

integrate((b*tan(d*sqrt(x) + c) + a)^2*x^2, x)

Mupad [F(-1)]

Timed out. \[ \int x^2 \left (a+b \tan \left (c+d \sqrt {x}\right )\right )^2 \, dx=\int x^2\,{\left (a+b\,\mathrm {tan}\left (c+d\,\sqrt {x}\right )\right )}^2 \,d x \]

[In]

int(x^2*(a + b*tan(c + d*x^(1/2)))^2,x)

[Out]

int(x^2*(a + b*tan(c + d*x^(1/2)))^2, x)